﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace Obra.Api
{
    public interface IAlbum : 
        IEntity
    {
        /// <summary>
        /// Does this album contain a media with the specified name.
        /// </summary>
        /// <param name="mediaName">
        /// Name of the media to match.
        /// </param>
        /// <returns>
        /// True if the media exists.
        /// </returns>
        bool Contains(string mediaName);

        /// <summary>
        /// Get the IMedia for the specified mediaName.
        /// </summary>
        /// <param name="mediaName">
        /// The media name to fetch.
        /// </param>
        /// <returns>
        /// IMedia
        /// </returns>
        /// <exception cref="KeyNotFoundException">
        /// Thrown if no matching media exists.
        /// </exception>
        IMedia this[string mediaName]
        {
            get;
        }

        /// <summary>
        /// Collection of media in this album.
        /// </summary>
        /// <remarks>
        /// <para>
        /// This is a ICollection, so that deleted media can be pruned as 
        /// opposed to an IEnumerable where they cannot.
        /// </para>
        /// </remarks>
        ICollection<IMedia> Media
        {
            get;
        }
    }
}
